/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package games.kamisado;

import games.KamisadoState;
import games.KamisadoState.KamisadoMove;

/**
 *
 * @author Mikael
 */
public class MoveBuilder {
    private final KamisadoState state;
    private int y;
    private int oldY;
    private int oldX;
    private int x;
    
    

    MoveBuilder(KamisadoState state) {
        this.state = state;
    }

    MoveBuilder y(int oldY, int newY) {
        this.oldY = oldY;
        this.y = newY;
        
        return this;
    }

    MoveBuilder x(int oldX, int newX) {
        this.oldX = oldX;
        this.x = newX;
        
        return this;
    }

    KamisadoMove build() {
        KamisadoMove move = new KamisadoMove(x, y, oldX, oldY, state.getTower(oldX, oldY));
        oldY = 0;
        oldX = 0;
        y = 0;
        x = 0;
        return move;
    }

    
}
